package com.example.dao;

import java.io.IOException;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

public class ConnetWeb {
		
		String str;
		
		public String connectweb(String url){
			HttpGet request=new HttpGet(url);
			try {
				HttpResponse response=new DefaultHttpClient().execute(request);
				if(response.getStatusLine().getStatusCode()==200){
					str=EntityUtils.toString(response.getEntity());
					
				}
			} catch (ClientProtocolException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return str; 
			
		}
		
		
		
		
}
